Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
How `String["fromCharCode"]` acts like `String.fromCharCode()` in javascript?

Search engine will ignore the [ ] ", so I can't get the answer. I took a test and find out they resulted the same, but I'm a js rookie and I don't know how they equals to each other.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

fromCharCode 'lives' as a static method of the String Object. Such a method has a key and a value, visualised: {fromCharCode: function() {...}}. You can retrieve (access) the method using it's key directly String.fromCharCode or 'bracket' style String['fromCharCode']. This is true for all Objects.

The bracket notation may be usefull when the key contains special characters, see snippet.

See also

const someObj = {
  dotNotation: 'hello world',
  'non dot Notation': 'hello world you too',
};

console.log(someObj.dotNotation);
// the last property can not be retrieved with dot notation
// console.log(someObj.non dot Notation);
// so
console.log(someObj['non dot Notation']);

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda